package com.epro.standard.frontend.datasetup;

import java.io.IOException;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

import com.epro.standard.frontend.util.StringUtil;

/**
 * @author linny
 * Created Date 12 �.�. 2003
 *
 */
public class MessageManager {
    private Connection con;
    private Statement stmt;
    private ResultSet rs;

    private static final String BUNDLE_NAME = 
        "com.epro.standard.FrontendSetting"; //$NON-NLS-1$
    private static final ResourceBundle RESOURCE_BUNDLE = 
        ResourceBundle.getBundle(BUNDLE_NAME);


    public MessageManager() {
    }

    public static String getString(String key) {
        try {
            return RESOURCE_BUNDLE.getString(key);
        } catch (MissingResourceException e) {
            return "";
        }
    }

    public static String getInsertSuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("INSERT_SUCCESS"));
        return str;
    }

    public static String getInsertUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("INSERT_UNSUCCESS"));
        return str;
    }

    public static String getUpdateUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("UPDATE_UNSUCCESS"));
        return str;
    }

    public static String getUpdateSuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("UPDATE_SUCCESS"));
        return str;
    }

    public static String getUpdateSuccessAllString() throws IOException {
        String str = StringUtil.encode2Thai(getString("UPDATE_ALL"));
        return str;
    }

    public static String getDeleteSuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("DELETE_SUCCESS"));
        return str;
    }

    public static String getDeleteSuccessALLString() throws IOException {
        String str = StringUtil.encode2Thai(getString("DELETE_ALL"));
        return str;
    }

    public static String getDeleteUnSelectString() throws IOException {
        String str = StringUtil.encode2Thai(getString("DELETE_FORGET_SELECT"));
        return str;
    }

    public static String getDeleteUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("DELETE_UNSUCCESS"));
        return str;
    }

    public static String getUnChangeDataString() throws IOException {
        String str = StringUtil.encode2Thai(getString("UNCHANGE"));
        return str;
    }

    public static String getUnitString() throws IOException {
        String str = StringUtil.encode2Thai(getString("SUCCESS_UNIT"));
        return str;
    }

    public static String getDoseNotSignInString() throws IOException {
        String str = StringUtil.encode2Thai(getString("DOSE_NOT_LOGIN"));
        return str;
    }

    public static String getMasterWidth() throws IOException {
        String str = getString("MASTER_WIDTH");
        return str;
    }

    public static String getMasterDetailWidth() throws IOException {
        String str = "" + (Integer.parseInt(getString("MASTER_WIDTH")) - 50);
        return str;
    }

    public static String getProgramGroup() throws IOException {
        String str = StringUtil.encode2Thai(getString("PROGRAM_GROUP"));
        return str;
    }

    public static int getStartListOfYear() throws IOException {
        int str = Integer.parseInt(getString("LIST_OF_YEAR_START"));
        return str;
    }

    public static int getEndListOfYear() throws IOException {
        int str = Integer.parseInt(getString("LIST_OF_YEAR_END"));
        return str;
    }


    public static String getCopyUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("COPY_UNSUCCESS"));
        return str;
    }

    public static String getCopySuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("COPY_SUCCESS"));
        return str;
    }

    public static String getCopyUnSelectString() throws IOException {
        String str = StringUtil.encode2Thai(getString("COPY_FORGET_SELECT"));
        return str;
    }

    public static String getverifySuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("VERIFY_SUCCESS"));
        return str;
    }

    public static String getverifyUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("VERIFY_UNSUCCESS"));
        return str;
    }

    public static String getconfirmSuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("COMFIRM_SUCCESS"));
        return str;
    }

    public static String getconfirmUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("COMFIRM_UNSUCCESS"));
        return str;
    }

    public static String getUploadUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("OVER_UPLOAD"));
        return str;
    }

    public static String getClosecaseSuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("CLOSECASE_SUCCESS"));
        return str;
    }

    public static String getClosecaseUnsuccessString() throws IOException {
        String str = StringUtil.encode2Thai(getString("CLOSECASE_UNSUCCESS"));
        return str;
    }


}
